#ifndef ST_USART_HPP
#define ST_USART_HPP

#include "camellia/utils/SerialPort/SerialPort.hpp"

namespace ST {

class SerialPort : public ::SerialPort {
public:
    enum class TransferMode {
        Polling,
        Interrupt,
        DMA,
    };
public:
    virtual bool setTxMode(TransferMode mode) = 0;
    virtual TransferMode getTxMode(void) = 0;
    virtual bool setRxMode(TransferMode mode) = 0;
    virtual TransferMode getRxMode(void) = 0;
    
    virtual bool setPinmap(int pin_map) = 0;
    virtual int getPinmap(void) = 0;

    static ST::SerialPort *getInstance(int serial_port_number);
    static bool freeInstance(ST::SerialPort *instance);
};

}

#endif